<?php echo View::factory('admin/common/breadcrumbs')->set('breadcrumbs', $breadcrumbs)->render(); ?>
<div class="page-content">
    <div class="page-header">
        <h1>
            Import User     
        </h1>
    </div>
    <?php echo View::factory('admin/common/messege')->render(); ?>
    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <div class="row-fluid">
                <div class="span12">
                    <div class="widget-box">
                        <div class="widget-header widget-header-blue widget-header-flat">

                        </div>

                        <div class="widget-body">
                            <div class="widget-main">
                                <iframe name="frmimport" id="frmimport" class="hidden" > </iframe>
                                <form target="frmimport" autocomplete="off" class="form-horizontal" id="validation-form" method="post">
                                    <div class="step-content row-fluid position-relative" id="step-container">
                                        <div class="space-2"></div>

                                        <div class="form-group">
                                            <label class="control-label col-xs-12 col-sm-3 no-padding-right" for="platform">Image:</label>

                                            <div class="col-xs-12 col-sm-9">
                                                <div class="clearfix">
                                                    <div id="uploadavatar"></div>
                                                    <br>

                                                    <input type="text" style="width: 100%;" readonly="" name="imagename" id="imagename"  />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="space-8"></div>
                                    </div>

                                    <hr />
                                    <div class="row-fluid wizard-actions">

                                        <button id="cmdsave" type="submit" class="btn btn-success btn-next" data-last="Finish ">
                                            Import
                                            <i class="icon-arrow-right icon-on-right"></i>
                                        </button>
                                        <img id="loading" style="display: none;" src="<?= $url_base_theme . '/img/loading_1.gif' ?>" />
                                    </div>
                                </form>
                            </div><!-- /widget-main -->
                        </div><!-- /widget-body -->
                    </div>
                </div>
            </div>
            <!-- PAGE CONTENT ENDS -->
        </div><!-- /.col -->
    </div><!-- /.row -->
</div>
<script>
    $('#uploadavatar').ajaxupload({
        url: url_base_media + '/upload_file.php',
        remotePath: '<?= Controller_Helper_Constant::FOLDER_TEMP ?>',
        maxFiles: 1,
        //editFilename:true,
        autoStart: true,
        bootstrap: true,
        allowExt: ['csv'],
        maxFileSize: "10M",
        removeOnSuccess: true,
        data: 'type=user&u=' + user_id + "&session=" + session,
        success: function(name) {
            jQuery("#imageuploadcontent").show();

            jQuery("#imagename").val(name);
        },
        error: function(txt, fileName) {
            jQuery("#cmdSave").removeAttr("disabled", "disabled");
        },
        onInit: function(au)
        {
            //hide remove files and upload button
            au.removeFiles.hide();
            au.uploadFiles.hide();
            jQuery(".ax-legend").hide();
        }

    });


</script>